//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================
//#include "RcSysPktLib.h"

/*
//note: always call  AddNickName then AddDesc then AddPluginName
void RcSysPktFindFile::AddNickName( std::string &csName )
{
	char as8Buf[ MAX_PATH ];
	if( csName.size() )
	{
		strcpy( as8Buf, (const char *)csName.c_str() );
		as8Buf[ RC_SYS_PKT_FIND_NODE_MAX_NAME_LEN ] = 0;
		VxChopStr( as8Buf, m_au8Additional );
		m_u32Flags |= RC_SYS_PKT_FIND_NODE_HAS_NICKNAME;
	}
	else
	{
		m_u32Flags &= ~RC_SYS_PKT_FIND_NODE_HAS_NICKNAME;
	}
}
void RcSysPktFindFile::AddDesc( std::string &csDesc )
{
	char as8Buf[ MAX_PATH ];
	if( csDesc.size() )
	{
		unsigned char * pu8Temp = m_au8Additional;
		if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_NICKNAME )
		{
			pu8Temp +=  * pu8Temp;
		}
		strcpy( as8Buf, (const char *)csDesc.c_str() );
		as8Buf[ RC_SYS_PKT_FIND_NODE_MAX_NAME_LEN ] = 0;
		VxChopStr( as8Buf, pu8Temp );
		m_u32Flags |= RC_SYS_PKT_FIND_NODE_HAS_DESC;
	}	
	else
	{
		m_u32Flags &= ~RC_SYS_PKT_FIND_NODE_HAS_DESC;
	}
}
void RcSysPktFindFile::AddPluginName( std::string &csPluginName )
{
	char as8Buf[ MAX_PATH ];
	if( csPluginName.size() )
	{
		unsigned char * pu8Temp = m_au8Additional;
		if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_NICKNAME )
		{
			pu8Temp +=  * pu8Temp;
		}
		if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_DESC )
		{
			pu8Temp +=  * pu8Temp;
		}
		strcpy( as8Buf, (const char *)csPluginName.c_str() );
		as8Buf[ RC_SYS_PKT_FIND_NODE_MAX_NAME_LEN ] = 0;
		VxChopStr( as8Buf, pu8Temp );
		m_u32Flags |= RC_SYS_PKT_FIND_NODE_HAS_TC_PLUGIN_NAME;
	}	
	else
	{
		m_u32Flags &= ~RC_SYS_PKT_FIND_NODE_HAS_TC_PLUGIN_NAME;
	}
}
void RcSysPktFindFile::CalcLen( void )
{
	m_u16PktLen = sizeof(RcSysPktFindFile ) - sizeof( m_au8Additional );
	unsigned char * pu8Temp = m_au8Additional;
	if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_NICKNAME )
	{
		m_u16PktLen += * pu8Temp;
		pu8Temp +=  * pu8Temp;
	}
	if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_DESC )
	{
		m_u16PktLen += * pu8Temp;
		pu8Temp +=  * pu8Temp;
	}
	if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_TC_PLUGIN_NAME )
	{
		m_u16PktLen += * pu8Temp;
		pu8Temp +=  * pu8Temp;
	}
	m_u16PktLen = (( m_u16PktLen + 15 ) & ~15 );
}
void RcSysPktFindFile::GetNickName( std::string &csName )
{
	unsigned char * pu8Temp = m_au8Additional;
	if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_NICKNAME )
	{
		char as8Buf[ RC_SYS_PKT_FIND_NODE_MAX_NAME_LEN ];
		VxUnchopStr( pu8Temp, as8Buf );
		csName = as8Buf;
	}
	else
	{
		csName = "";
	}
}
void RcSysPktFindFile::GetDesc( std::string &csDesc )
{
	unsigned char * pu8Temp = m_au8Additional;
	if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_DESC )
	{
		if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_NICKNAME )
		{
			pu8Temp +=  * pu8Temp;
		}
		if( m_u32Flags & RC_SYS_PKT_FIND_NODE_HAS_DESC )
		{
			pu8Temp +=  * pu8Temp;
		}
		char as8Buf[ RC_SYS_PKT_FIND_NODE_MAX_NAME_LEN ];
		VxUnchopStr( pu8Temp, as8Buf );
		csDesc = as8Buf;
	}
	else
	{
		csDesc = "";
	}
}
*/




